package org.hdax.dm.vo;

import org.hda.dm.utils.exception.DmException;
import org.hdax.dm.vo.CommonResponse;

public class VoUtil {
    private static String success = "success";

    public static CommonResponse returnSuccess(Object data) {
        CommonResponse commonResponse = new CommonResponse(success, "0000", data);
        return commonResponse;
    }

    public static CommonResponse returnFail(String errorCode, DmException exception) {
        CommonResponse commonResponse = new CommonResponse(errorCode, exception.getMessage());
        return commonResponse;
    }

}
